#!/bin/bash
export BOOTSTRAP_TOKEN=$(head -c 16 /dev/urandom | od -An -t x | tr -d ' ') 
source /etc/profile
cd /etc/kubernetes && touch token.csv
cat > token.csv <<EOF
${BOOTSTRAP_TOKEN},kubelet-bootstrap,10001,"system:kubelet-bootstrap"
EOF
TOKEN=`cat all.yml | awk '/BOOTSTRAP_TOKEN/' | awk -NF \" '{print $2}'`
sed "s/"${TOKEN}"/"${BOOTSTRAP_TOKEN}"/" /root/deploy-ansible/k8s/group_vars/all.yml
